<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePlansTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('plans', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamp('start')->nullable()->comment('开始时间');
            $table->timestamp('end')->nullable()->comment('结束时间');
            $table->unsignedInteger('shop_id')->index()->comment('门店ID');
            $table->unsignedInteger('user_id')->index()->comment('创建者');
            $table->unsignedInteger('xun_dian_ji_lu_id')->nullable()->index()->comment('巡店记录id');
            $table->boolean('status')->comment('计划状态');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('plans');
    }
}
